import request from '@/config/axios'

// PI 巡检配置单-房产 VO
export interface ConfigureHouseVO {
  id: number // 编号
  houseId: number // 房产Id
  houseName: string // 房产名称
}

// PI 巡检配置单-房产 API
export const ConfigureHouseApi = {
  // 查询PI 巡检配置单-房产分页
  getConfigureHousePage: async (params: any) => {
    return await request.get({ url: `/pi/configure-house/page`, params })
  },

  // 查询PI 巡检配置单-房产详情
  getConfigureHouse: async (id: number) => {
    return await request.get({ url: `/pi/configure-house/get?id=` + id })
  },

  // 新增PI 巡检配置单-房产
  createConfigureHouse: async (data: ConfigureHouseVO) => {
    return await request.post({ url: `/pi/configure-house/create`, data })
  },

  // 修改PI 巡检配置单-房产
  updateConfigureHouse: async (data: ConfigureHouseVO) => {
    return await request.put({ url: `/pi/configure-house/update`, data })
  },

  // 删除PI 巡检配置单-房产
  deleteConfigureHouse: async (id: number) => {
    return await request.delete({ url: `/pi/configure-house/delete?id=` + id })
  },

  // 导出PI 巡检配置单-房产 Excel
  exportConfigureHouse: async (params) => {
    return await request.download({ url: `/pi/configure-house/export-excel`, params })
  },

// ==================== 子表（PI 巡检配置单明细-房产） ====================

  // 获得PI 巡检配置单明细-房产列表
  getConfigureHouseItemsListByConfigureHouseId: async (configureHouseId) => {
    return await request.get({ url: `/pi/configure-house/configure-house-items/list-by-configure-house-id?configureHouseId=` + configureHouseId })
  },
}
